package com.cg.controller;

import com.cg.client.AppClient;
import com.cg.dto.Result;
import com.cg.entity.Banner;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName BannerController
 * @Description TODO
 * @Author CG
 * @Date 2024/1/7 15:46
 **/
@RestController
@RequestMapping("/banner")
public class BannerController {

    @Resource
    private AppClient appClient;

    /**
     * 查询轮播图列表
     */
    @GetMapping("/queryBannerList")
    public Result<List<Banner>> queryBannerList(){
        return appClient.queryBannerList();
    }


    /**
     * 根据id获取轮播图详情
     */
    @GetMapping("/queryBannerByBannerId")
    public Result<Banner> queryBannerByBannerId(Integer bannerId){
        return appClient.queryBannerByBannerId(bannerId);
    }
}
